package lumingweihua.future.cn.lumingweihua.home.domain;

import android.text.TextUtils;

import java.io.Serializable;

import lumingweihua.future.cn.baselibgxh.base.MyApplication;

/**
 * Created by Administrator on 2018/3/3.
 */

public class CheyuanData implements Serializable {
    private String id;
    private String avatar_url;//司机头像
    private String origin;//起点
    private String destination;//终点
    private String empty;//空车位置
    private String loading_time;//装货时间
    private String license;//车牌
    private String car_name;//司机姓名
    private String lat;//经纬度
    private String lon;//经纬度
    private String type;//罐体材质
    private String load;//最大载重
    private String status;//1已发出邀请 2未发出     我的车源//1有效车源 2失效车源
    private String source_status;//1待审核2已通过 3拒绝
    private String uid;//1自己发布的
    private String time;//失效时间
    private String reject_reason;//拒绝原因
    private String car_id;//
    private String linkname;//名称
    private String is_plat;//是否是平台的
    private String fast;
    private String hot_line;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getImg_path() {
        return avatar_url;
    }

    public void setImg_path(String img_path) {
        this.avatar_url = img_path;
    }

    public String getStartCity() {
        return origin;
    }

    public String getStartCity2() {
        try {
            if(origin!=null && origin.contains("省"))
                return origin.substring(origin.indexOf("省")+1);
        } catch (Exception e) {
            // TODO: handle exception
        }

        return origin;
    }

    public void setStartCity(String startCity) {
        this.origin = startCity;
    }

    public String getEndCity() {
        return destination;
    }

    public String getEndCity2() {
        try {
            if(destination!=null && destination.contains("省"))
                return destination.substring(destination.indexOf("省")+1);
        } catch (Exception e) {
            // TODO: handle exception
        }

        return destination;
    }

    public void setEndCity(String endCity) {
        this.destination = endCity;
    }

    public String getAddress() {
        return empty;
    }

    public void setAddress(String address) {
        this.empty = address;
    }

    public String getTime() {
        return loading_time;
    }

    public void setTime(String time) {
        this.loading_time = time;
    }

    public String getCarnum() {
        return license;
    }

    public void setCarnum(String carnum) {
        this.license = carnum;
    }

    public String getName() {
        return linkname;
    }

    public void setName(String name) {
        this.linkname = name;
    }

    public double getLat() {
        double l = 0;
        try {
            l = Double.valueOf(lat);
        } catch (Exception e) {
            // TODO: handle exception
        }
        return l==0?30.26:l;
    }

    public void setLat(String lat) {
        this.lat = lat;
    }

    public double getLon() {
        double l = 0;
        try {
            l = Double.valueOf(lon);
        } catch (Exception e) {
            // TODO: handle exception
        }
        return l==0?120.19:l;
    }

    public void setLon(String lon) {
        this.lon = lon;
    }

    public String getQuality() {
        return type;
    }

    public void setQuality(String quality) {
        this.type = quality;
    }

    public String getWeight() {
        return load;
    }

    public void setWeight(String weight) {
        this.load = weight;
    }

    public String getState() {
        return status;
    }

    public void setState(String state) {
        this.status = state;
    }

    public boolean getIsself() {
        return MyApplication.getInstance().getUserId().equals(uid);
    }

    public void setIsself(String isself) {
        this.uid = isself;
    }

    public String getCar_name() {
        return car_name;
    }

    public void setCar_name(String car_name) {
        this.car_name = car_name;
    }

    public String getSource_status() {
        return source_status;
    }

    public void setSource_status(String source_status) {
        this.source_status = source_status;
    }

    public String getUnableTime() {
        return time;
    }

    public void setUnableTime(String unableTime) {
        this.time = unableTime;
    }

    public String getReject_reason() {
        return TextUtils.isEmpty(reject_reason)?"未填写":reject_reason;
    }

    public void setReject_reason(String reject_reason) {
        this.reject_reason = reject_reason;
    }

    public String getCar_id() {
        return car_id;
    }

    public void setCar_id(String car_id) {
        this.car_id = car_id;
    }
    public String getLinkname() {
        return linkname==null?"":linkname;
    }

    public void setLinkname(String linkname) {
        this.linkname = linkname;
    }

    public boolean getIs_plat() {
        return "1".equals(is_plat);
    }

    public void setIs_plat(String is_plat) {
        this.is_plat = is_plat;
    }

    public boolean getJiaji() {
        return "1".equals(fast);
    }

    public void setJiaji(String jiaji) {
        this.fast = jiaji;
    }

    public String getHot_line() {
        return hot_line;
    }

    public void setHot_line(String hot_line) {
        this.hot_line = hot_line;
    }
}
